package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.pojo.Emp;
import com.itheima.pojo.EmpQueryParam;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;


public interface EmpMapper extends BaseMapper<Emp> {

    @Select("select(case gender when 1 then '男性 ' when 2 then '女性'else '其他'end ) as name,count(*) value from emp group by gender")
    List<Map<String, Integer>> selectByGender();

    @Select("select(case job when 1 then '班主任' when 2 then '讲师' when 3 then '学工主管' when 4 then '教研主管' when 5 then '咨询师' else '其他'end ) jobList,count(*) dataList from emp group by job")
    List<Map<String, Integer>> selectByEmp();
}
